import torch

x = torch.tensor(4.0 ,requires_grad=True)
y = x ** 2
print(y)
print(y.grad_fn)
y.backward()
print(x.grad)


x = torch.tensor(1.0,requires_grad=True)
y = torch.tensor(2.0)
z = x * y

for i ,name in zip([x,y,z],"xyz"):
    print(i,name)